{extend name="public:base" /}
{block name="theme"}任务管理{/block}
{block name="small_theme"}任务目标设置{/block}
{block name="breadcrumb"}
<li><a href="{:url('index')}">任务目标设置</a></li>
<li class="active">任务目标设置</li>
{/block}
{block name="content"}
<!--<link rel="stylesheet" href="__CSS__/style.css">-->
<link rel="stylesheet" href="__CSS__/indexcommon.css">

<!-- 列表开始 -->
<div class="row">
    <div class="col-xs-12">
        <div class="box box-list">
            <div class="box-header" data-original-title="" style="height: 40px;">
                <a href="{:url('add')}"  class="btn"><h2 style="margin-top: 0;"><i class="glyphicon glyphicon-plus"></i> 增加总任务</h2></a>
                <!--<a href="javascript:add('{:url('add_Yaoyue')}');" class="btn"><h2 style="margin-top: 0;"><i class="glyphicon glyphicon-plus-sign"></i> 新增邀约目标</h2></a>-->
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding" style="border-bottom: 1px solid #dfdfdf;overflow: hidden;">
                <table class="table table-striped table-bordered table-condensed">
                    <tr>
                        <th>ID</th>
                        <th>任务类型</th>
                        <th>月份</th>
                        <th>目标</th>
                        <th>操作</th>
                    </tr>
                    {volist name='info' id="vo" }
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.rwlx_text}</td>
                        <td>{$vo.date}</td>
                        <td>{$vo.renwu}</td>
                        <td>
                            <a href="{:url('editall',['date'=>$vo.date])}" class="btn btn-success btn-xs" style="color: #fff">修改月目标</a>
                            {if condition='$vo.rwlx_id == 1 || $vo.rwlx_id == 2 '}
                                {eq name='vo.next' value='1'}
                                <a href="javascript:edit('{:url('edit_Yaoyue',['rwlx_id'=>$vo.rwlx_id,'date'=>$vo.date])}');" class="btn btn-info btn-xs" style="color: #fff" >修改邀约目标</a>
                                {else /}
                                <a href="javascript:add('{:url('add_Yaoyue', ['rwlx_id'=>$vo.rwlx_id,'date'=>$vo.date])}');" class="btn btn-warning btn-xs" style="color: #fff">新增邀约目标</a>
                                {/eq}
                            {/if}
                        </td>
                    </tr>
                    {/volist}

                </table>
            </div>
            <div class="page">{$page}</div>
        </div>
        <!-- /.box -->
    </div>
</div>
<!-- 列表结束 -->
</div>
{/block}

{block name="js"}
<script type="text/javascript">

    function add(name) {
        layer.open({
            type: 2,
            title: '<h4>新增子目标</h4>',
            shadeClose: true,
            shade: 0.8,
            area: ['850px', '80%'],
            content:name //iframe的url
        });
    }

    function edit(name) {
        $.get(name,function(msg){
//            console.log(msg);

            if(msg.code == 0){
                layer.msg(msg.msg, {icon: msg.icon});
            }else{
                layer.open({
                    type: 2,
                    title: '<h4>修改子目标</h4>',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['850px', '80%'],
                    content:name //iframe的url
                });
            }

        });
    }

    highlight_subnav("{:url('index')}");
</script>
{/block}
